\documentclass[a4paper,draft,oneside]{article}

\reversemarginpar

\usepackage{mathptmx}
\usepackage{a4wide}
\usepackage{xcolor}
\usepackage[italian]{babel}
\usepackage{amsmath}
\usepackage{stmaryrd}
\usepackage{mathpartir}
\usepackage{calrsfs}

\newcommand{\NT}[1]{\langle\mathit{#1}\rangle}
\newcommand{\T}[1]{\mathit{#1}}

\newcommand{\flang}{$\mathcal{F}$}
\newcommand{\olang}{$\mathcal{O}$}

\newcommand{\INT}{\T{int}}
\newcommand{\BOOL}{\T{bool}}
\newcommand{\FLOAT}{\T{float}}
\newcommand{\STRING}{\T{string}}
\newcommand{\SYMBOL}{\T{symbol}}

\newcommand{\EXPR}{E}
\newcommand{\VAL}{v}
\newcommand{\VARVAL}{w}
\newcommand{\VAR}{x}
\newcommand{\REF}{r}
\newcommand{\RULE}{\NT{rule}}
\newcommand{\CONST}{\NT{const}}
\newcommand{\PATTERN}{\NT{pattern}}
\newcommand{\BIND}{\NT{bind}}
\newcommand{\GLOBAL}{\NT{global}}

\newcommand{\CLASS}{\mathsf{CL}}
\newcommand{\CLASSID}{\mathsf{C}}
\newcommand{\VARCLASSID}{\mathsf{D}}
\newcommand{\FIELDID}{\mathsf{f}}
\newcommand{\VARFIELDID}{\mathsf{g}}
\newcommand{\METHODID}{\mathsf{m}}
\newcommand{\OBJECTID}{\mathsf{o}}
\newcommand{\VAROBJECTID}{\mathsf{p}}
\newcommand{\FIELD}{\NT{field}}
\newcommand{\HEAP}{h}
\newcommand{\CTOR}{K}
\newcommand{\METHOD}{M}
\newcommand{\nil}{\mathtt{nil}}

\newcommand{\INSTR}[1]{\mathsf{#1}}
\newcommand{\TRUE}{\mathsf{true}}
\newcommand{\FALSE}{\mathsf{false}}

\newcommand{\BOXN}[1]{[]_{#1}}
\newcommand{\BOX}[1]{[#1]}
\newcommand{\ENV}{\mathcal{E}}
\newcommand{\LOC}{\mathcal{L}}
\newcommand{\ARGS}{\mathcal{A}}

\newcommand{\TRANS}{\Rightarrow}
\newcommand{\AFTER}{\vdash}

\newcommand{\sequence}[1]{\overline{#1}}

\newcommand{\EVAL}[1]{\mathcal{E}[#1]}
\newcommand{\COMPILE}[2]{\llbracket#1\rrbracket_{#2}}

\newcommand{\rtsyntax}[1]{\colorbox{lightgray}{\ensuremath{#1}}}
\newcommand{\subst}[2]{
	\{ 	\raisebox{.5ex}{$#1$}  /  
			\raisebox{-.5ex}{$#2$} \} 
	} % substitution
\newcommand{\subt}{\mathrel{<:}}
\newcommand{\fields}{\mathit{fields}}
\newcommand{\CT}{\mathit{CT}}
\newcommand{\body}{\mathit{body}}
\newcommand{\dom}{\mathrm{dom}}
\newcommand{\rulename}[1]{\textsc{(#1)}}

\newtheorem{extension}{Estensione}

\title{Implementazione orientata a oggetti puri \\ di un linguaggio funzionale}

\begin{document}

\maketitle

\section{Compilazione}

\begin{table}
\caption{\label{tab:fsyntax} Compilazione di Funzioni~.}
\framebox[\textwidth]{
\begin{math}
\displaystyle
\begin{array}{rcl@{\qquad}l}
\llbracket~\mathtt{fun}~x_1\cdots x_n\to~e\rrbracket_f^{BV} & ::= & new~C(\llbracket y\rrbracket_f^{BV}) & y~\in~fv(e) \backslash~{x_1\cdots x_n} \\
\\
  C & ::= & \mathtt{class}~\CLASSID~\mathtt{extends}~Closure_n~\{\\
 && \sequence{\CLASSID}~\sequence{y};\\
 && \mathtt{value~apply_n~}~(~\sequence{\CLASSID}~\sequence{x}~)~\{\\
 && \qquad~\llbracket e \rrbracket_{this.apply_n}^{BV~\cup\{\sequence{x}\}}~{\subst{\mathtt{this.apply_n}}{\CLASSID}~}~\}~ \\
 && \CLASSID~(\sequence{y})~\{~\mathtt{this.\sequence{y}~=~\sequence{y}~}~\}~\\
 && \} \\
\\
\end{array}
\end{math}
}
\end{table}

\end{document}



